package com.cloud.yidiandao.service.impl;

import com.cloud.yidiandao.entity.PointsRule;
import com.cloud.yidiandao.dao.PointsRuleDao;
import com.cloud.yidiandao.service.intf.PointsRuleService;
import com.cloud.yidiandao.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @program: yidiandao
 * @description: 一点就到物流app
 * @author: yidiandao-
 * @create: 2021-01-09 20:17:59
 */
@Service
public class PointsRuleServiceImpl implements PointsRuleService{
    /*
    *注入持久层对象*/
    @Autowired
    private PointsRuleDao dao;
    /*
    * 新增内容*/
    @Override
    public R save(PointsRule pointsRule) {
        if(pointsRule!=null){
            if(dao.insert(pointsRule)>0){
                return R.ok();
            }
        }
        return R.fail("新增异常");
    }
    /*
    * 查询 所有数据*/
    @Override
    public R queryAll() {
        return R.ok(dao.selectAll());
    }
}